home *** CD-ROM | disk | FTP | other *** search
/ Komputer for Alle 2004 E…tra 100 Bedste Programmer / K-CD_2004_Ekstra_100_Gratis_Programmer.iso / Windows / X-Setup / xqdcXSP-Setup-EN.exe / {app} / plugins / XQ WinXP AutoPlay 1.xpl < prev    next >
Encoding:
XSetup plugin  |  2003-12-24  |  4.0 KB  |  122 lines

  1. "FILE"="Xteq Systems X-Setup Plugin 6.0"
  2. "TYPE"="6"
  3. "COUNT"="4"
  4. "UIPATH"="System\AutoPlay\Data CDs Options"
  5. "NAME"="AutoPlay Data CDs (XP)"
  6. "VERSION"="1.16"
  7. "LANGUAGE"="VBScript"
  8. "OSVERSION"="0000011"
  9. "TEXT 1"="Allow autostart for CD-ROMs (normal)"
  10. "TEXT 2"="Allow autostart for removable drives (diskettes, ZIP)"
  11. "TEXT 3"="Allow autostart for fixed drives (HD)"
  12. "TEXT 4"="Allow autostart for network drives"
  13. "DESCRIPTION 1"="If you normally insert a CD in your CD-ROM-drive, Windows starts a program using the file AUTORUN.INF or displays a selection of commands you can execute. "
  14. "DESCRIPTION 2"="This behaviour is known as "AutoPlay". By default, it's activated for the first three choices but you enable or disable other types of drives here also." 
  15. "DESCRIPTION 3"="IMPORTANT: If you activate AutoRun for removable devices or network drives, Windows will check these drives every time you open the Explorer or a file requester in an application. Because this check takes some time, this behavior can be really annoying. Please keep this in mind."
  16. "AUTHOR"="Xteq Systems"
  17. "CONTACTURL"="http://www.xteq.com"
  18. "COPYRIGHT"="Copyright ⌐ Xteq Systems - All Rights Reserved"
  19. "COMMENT 1"="Thanks to Matthias Mei▀er [digi_c@web.de] for developing this Windows XP version with us."
  20. "COMMENT 2"="This was a hell lot of work!" 
  21. "COMMENT 3"="Special thanks to Tony Caine (72614.1451@compuserve.com) who has helped us a lot with this plug-in. Also thanks to Guy (dr_teeth@bigfoot.com)."
  22. "COMMENT 4"="Thanks to Sander Goudswaard [sander@goudswaard.cx] for the "...START vs ...RUN" notice!"
  23. "COMMENT 5"="Thanks to totalXS for his help!"
  24.  
  25.  
  26. 'Declaration of some constants
  27. DRIVE_UNKNOWN=1   'Bit 0
  28. DRIVE_NO_ROOT=2   'Bit 1
  29. DRIVE_REMOVABLE=4 'Bit 2 
  30. DRIVE_FIXED=8     'Bit 3 
  31. DRIVE_REMOTE=16   'Bit 4 
  32. DRIVE_CDROM=32    'Bit 5 
  33. DRIVE_RAMDISK=64  'Bit 6 
  34. DRIVE_FUTURE=128  'Bit 7 
  35.  
  36. sPathValue="HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoDriveTypeAutoRun"
  37.  
  38. 'Called when the Plugin is started
  39. SUB Plugin_Initialize
  40.  i=RegReadValue(sPathValue)
  41.  if IsEmpty(i)=true then
  42.     i=145
  43.  end if
  44.  
  45.  if IsNumeric(i)=false then
  46.     Call MsgWarning("The current AutoPlay feature settings in your registry are in an incorrect form (REG_BINARY instead of REG_DWORD). These values will be ignored and the default values, as they are out of the box, will be displayed.")
  47.     i=145
  48.  end if
  49.  
  50.  
  51.  'TH: Looks stupid, I know! but there is no way to get OR working with variants!
  52.  'AK: JScript ||. Should work
  53.  
  54.  dim b1,b2,b3,b4,b5,b6,b7
  55.  i=OrHelper(i,DRIVE_FUTURE,b1)
  56.  i=OrHelper(i,DRIVE_RAMDISK,b2) 
  57.  i=OrHelper(i,DRIVE_CDROM,b3)
  58.  i=OrHelper(i,DRIVE_REMOTE,b4)
  59.  i=OrHelper(i,DRIVE_FIXED,b5)
  60.  i=OrHelper(i,DRIVE_REMOVABLE,b6)
  61.  i=OrHelper(i,DRIVE_NO_ROOT,b7)
  62.  
  63.  
  64.  '//If the bit is set, AutoRun is DISABLED
  65.  Call SetBox(b3,1)
  66.  Call SetBox(b6,2)
  67.  Call SetBox(b5,3)
  68.  Call SetBox(b4,4)
  69. END SUB
  70.  
  71. Function OrHelper(CurValue,CheckVal,CheckValSet)
  72.  i=CurValue
  73.  
  74.  if i>=CheckVal then
  75.     CheckValSet=true
  76.     i=i-CheckVal
  77.  else
  78.     CheckValSet=false
  79.  end if
  80.  
  81.  OrHelper=i
  82. End Function
  83.  
  84. Sub SetBox(CurVal,Elm)
  85.     if CurVal=true then
  86.        SetUIElement elm,false
  87.     else
  88.        SetUIElement elm,true
  89.     end if
  90. End Sub
  91.  
  92.  
  93. 'Called when the Plugin should validate the Data the user has entered
  94. SUB Plugin_CheckData(ElementIndex)
  95. END SUB
  96.  
  97. 'Called when the Plugin should apply the changes
  98. SUB Plugin_Apply(ElementIndex,ElementSubIndex)
  99.  i=0
  100.  
  101.  'Always disable autorun for the following drives 
  102.  'according to Q136214 from MS KB
  103.  i=i+DRIVE_UNKNOWN
  104.  i=i+DRIVE_FUTURE
  105.  '//Needed??? i=i+DRIVE_NO_ROOT
  106.  
  107.  
  108.  'No let's see what the user wants
  109.  if GetUIElement(1)=false then i=i+DRIVE_CDROM
  110.  if GetUIElement(2)=false then i=i+DRIVE_REMOVABLE
  111.  if GetUIElement(3)=false then i=i+DRIVE_FIXED
  112.  if GetUIElement(4)=false then i=i+DRIVE_REMOTE
  113.  
  114.  
  115.  Call RegWriteValue(sPathValue,i,2)
  116.  Call Logoff()
  117. END SUB
  118.  
  119. 'Called when the Plugin is about to be removed from memory
  120. SUB Plugin_Terminate
  121. END SUB
  122.